///import js-src/lib/
///import js-src/com/
qui(function (require, exports, module) {
    Specimen.Config = $.extend({}, {}, {
        TABLE_COLMODEL_CONFIG: {
            album_id: {
                name: "album_id",
                index: 'album_id',
                title: false,
                width: 120,
                align: "center",
                sortable: false
            },
            qipu_id: {
                name: "qipu_id",
                index: 'qipu_id',
                title: false,
                width: 120,
                align: "center",
                sortable: false
            },
            news_name: {
                name: "news_name",
                index: 'news_name',
                title: false,
                width: 120,
                align: "center",
                sortable: false
            },
            album_name: {
                name: "album_name",
                index: 'album_name',
                title: false,
                width: 120,
                align: "center",
                sortable: false
            },
            channel: {
                name: "channel",
                index: 'channel',
                title: false,
                width: 120,
                align: "center",
                sortable: false
            },
            status: {
                name: "status",
                index: 'status',
                title: false,
                width: 120,
                align: "center",
                sortable: false,
                formatter: function (v, o, r) {
                    return Specimen.Util.formatter.status(v, o, r);
                }
            },
            host_sample: {
                name: "host_sample",
                index: 'host_sample',
                title: false,
                width: 120,
                sortable: false,
                align: "center",
                formatter: function (v, o, r) {
                    return Specimen.Util.formatter.specimen_status(v, o, r);
                }
            },
            topic_sample: {
                name: "topic_sample",
                index: 'topic_sample',
                title: false,
                width: 120,
                sortable: false,
                align: "center",
                formatter: function (v, o, r) {
                    return Specimen.Util.formatter.specimen_status(v, o, r);
                }
            },
            specimen_operate: {
                title: false,
                sortable: false,
                width: 220,
                align: "center",
                formatter: function (v, o, r) {
                    return Specimen.Util.formatter.specimen_operate(v, o, r);
                }
            },
            date_range: {
                name: "date_range",
                index: 'date_range',
                title: false,
                width: 130,
                align: "center",
                sortable: false,
                formatter: function (v, o, r) {
                    return Specimen.Util.formatter.date_range(v, o, r);
                }
            },
            specimen_download: {
                title: false,
                sortable: false,
                width: 120,
                align: "center",
                formatter: function (v, o, r) {
                    return Specimen.Util.formatter.specimen_download(v, o, r);
                }
            },
            //   colModel: ["rar_name", "download_url"],
            rar_name:{
                name:"name",
                title: false,
                sortable: false,
                width: 120
            },
            download_url: {
                name: "down_path",
                title: false,
                sortable: false,
                width: 120,
                formatter: function (v, o, r) {
                    return Specimen.Util.formatter.download_url(v, o, r);
                }
            }
        },
        TABLE_LIST: {
            beforeProcessing: function (data, status, xhr) {
                var self = this;
                var listData = data.data;
                listData.total =  parseInt( listData.total);
                listData.pageSize =  parseInt( listData.pageSize);
                listData.pageNo = parseInt( listData.pageNo);
                var rest =  listData.total % listData.pageSize;
                listData.totalPages = (listData.total - rest ) / listData.pageSize + (rest == 0 ? 0 : 1);
                listData.result =  listData.result == null ? [] : listData.result;
                var fillData = {"total": listData.totalPages, "page": listData.pageNo , "records": listData.total, "rows": listData.result};
                //{"total": total, "page": cur, "records": dataLength, "rows": showData}
                Specimen.Config.PageBeanSpecimen.setNewData(fillData.rows ,40);
                $("#list")[0].addJSONData(fillData);
                Specimen.Util.showNoResult(fillData.rows.length, "#list");
                return false;
            },
            jsonReader: {
                id: "album_id",
                root: "rows",
                page: "page",
                total: "total",
                records: "records"
            },
            mtype: "get",
            multiselect: false,
            datatype: "local",
            height: 450,
            rowNum: 40,
            caption: "新闻样本采集列表",
            colNames: ["专辑ID", "奇谱ID", "新闻名称", "专辑名称", "频道", "时间范围", "抽帧状态", "主持人帧采样状态", "新闻标题采样状态", "操作", "样本下载" ],
            colModel: ["album_id", "qipu_id", "news_name", "album_name", "channel", "date_range", "status", "host_sample", "topic_sample", "specimen_operate", "specimen_download" ],
            pager: "#pager",
            prmNames: {
                page: "pageNo",
                rows: "pageSize"
            }
        },
        TABLE_DOWNLOAD_LIST:{
            mtype: "get",
            multiselect: false,
            datatype: "local",
            colNames: ["压缩包名称", "样本下载"],
            colModel: ["rar_name", "download_url"],
            pager: "#dowloadpage",
            height: 350,
            width:600,
            rowNum: 40,
            prmNames: {
                page: "pageNo",
                rows: "pageSize"
            },
            onPaging: function (pgButton) {
                var retValue = Specimen.Util.pageBeanPageHandler("downloadList", "dowloadpage", Specimen.Config.PageBeanDownload, pgButton);
                if (retValue != null) {
                    $("#downloadList")[0].addJSONData(retValue)
                }
                return "stop";
            }
        },

        PageBeanSpecimen: null,
        PageBeanDownload:null,
        queryComponent: null,
        mock_mode: false,
        IS_ADD: false,
        IS_MODIFY: false,

        HOST_TEMPLATE: '<div class="f-left" id="cate-@pid"><img class="fragment-img" id="img-@pid" src="@src" ><br><span class="pid">@pid</span></div>',
        HOST_SIGN: '<div class="host_sign" ><label>主持人</label></div>',
        TABLE_TITLE:["主持人帧采样下载","新闻标题采样下载"],
        HINT_MSG:{
            AUTH_FORBIDDEN:"很抱歉，您没有权限!",
            ATUH_FORBIDDEN_DEL:"很抱歉，您没有删除权限!",
            CODE_SUC:"A00000"
        }
    })
})
//
